package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the CONSUMO database table.
 * 
 */
@Entity
@Table(name="CONSUMO")
public class Consumo implements Serializable {
	private static final long serialVersionUID = 1L;
	private long consumoId;
	private BigDecimal monto;
	private String tpoConsumo;
	private Date tsCrea;
	private Date tsModi;
	private Transaccion transaccion;
	private Movimiento movimiento;
	private Set<ConsumoSolicitud> consumoSolicituds;

    public Consumo() {
    }


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="CONSUMO_ID", unique=true, nullable=false)
	public long getConsumoId() {
		return this.consumoId;
	}

	public void setConsumoId(long consumoId) {
		this.consumoId = consumoId;
	}


	@Column(nullable=false, precision=12, scale=2)
	public BigDecimal getMonto() {
		return this.monto;
	}

	public void setMonto(BigDecimal monto) {
		this.monto = monto;
	}


	@Column(name="TPO_CONSUMO", nullable=false, length=1)
	public String getTpoConsumo() {
		return this.tpoConsumo;
	}

	public void setTpoConsumo(String tpoConsumo) {
		this.tpoConsumo = tpoConsumo;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_CREA")
	public Date getTsCrea() {
		return this.tsCrea;
	}

	public void setTsCrea(Date tsCrea) {
		this.tsCrea = tsCrea;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_MODI")
	public Date getTsModi() {
		return this.tsModi;
	}

	public void setTsModi(Date tsModi) {
		this.tsModi = tsModi;
	}


	//bi-directional many-to-one association to Transaccion
    @ManyToOne
	@JoinColumn(name="TRANS_ID")
	public Transaccion getTransaccion() {
		return this.transaccion;
	}

	public void setTransaccion(Transaccion transaccion) {
		this.transaccion = transaccion;
	}
	

	//bi-directional many-to-one association to Movimiento
    @ManyToOne
	@JoinColumn(name="MOVIMIENTO_ID", nullable=false)
	public Movimiento getMovimiento() {
		return this.movimiento;
	}

	public void setMovimiento(Movimiento movimiento) {
		this.movimiento = movimiento;
	}
	

	//bi-directional many-to-one association to ConsumoSolicitud
	@OneToMany(mappedBy="consumo")
	public Set<ConsumoSolicitud> getConsumoSolicituds() {
		return this.consumoSolicituds;
	}

	public void setConsumoSolicituds(Set<ConsumoSolicitud> consumoSolicituds) {
		this.consumoSolicituds = consumoSolicituds;
	}
	
}